<?php
header("Content-Type: text/html; charset=utf-8")
?>
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Lang" content="pt-br">
    <meta name="author" content="Carlos Barreto Feitoza Filho, Técnico Judiciário / Programador">
    <meta name="generator" content="PhpED 7.0">
    <meta name="description" content="Ferramenta para monitoramento do S.I.C.A.S.E.">
    <meta name="creation-date" content="06/01/2011">
    <title>S.I.C.A.S.E. Monitor</title>
    <script type="text/javascript" src="js/ptt/prototype.js"></script>
    <script type="text/javascript" src="js/sct/scriptaculous.js"></script>
    <script type="text/javascript" src="js/hch/adapters/prototype-adapter.js"></script>
    <script type="text/javascript" src="js/hch/highcharts.js"></script>
    <script type="text/javascript" src="js/hch/highcharts-more.js"></script>
    <script type="text/javascript" src="js/hch/themes/grid.js"></script>
    <script type="text/javascript" src="js/scripts.js"></script>
    <link rel="stylesheet" type="text/css" href="css/estilos.css">
    <script type="text/javascript">
      var guiasXDia;
      var guiasXDiaDiaAtual = "0001-01-01";
      var guiasAgora;
      
      var pagamentosIndevidosXDia;
      var pagamentosIndevidosXDiaDiaAtual = "0001-01-01";
      var pagamentosIndevidosAgora;

      var sumarioMonetarioXDia;
      var sumarioMonetarioDiaAtual = "0001-01-01";
      var sumarioMonetarioAgora;
      
      var atrasoArquivoRetorno;
      
      document.observe("dom:loaded"
                      ,function(event) {
      /* == Inicialização dos gráficos == */
      guiasXDia = new Highcharts.Chart({chart: {renderTo: "guiasxdia", type: "line", height: 300, width: 905}
                                       ,credits: { enabled: false }
                                       ,title: {text: "Guias X Dia"}
                                       ,subtitle: {text: "(Últimos sete dias)"}
                                       ,xAxis: {title: {text: "Dias da obtenção dos dados"}, categories: ["??/??/??","??/??/??","??/??/??","??/??/??","??/??/??","??/??/??","??/??/??"]}
                                       ,yAxis: {title: {text: "Quantidade"},alternateGridColor: "#EFEFEF"}
                                       ,tooltip: {enabled: true, formatter: function() {return "Guias " + this.series.name + ": " + this.y;}}
                                       ,legend: {align: "right", layout: "vertical", verticalAlign: "top", y: 45}
                                       ,plotOptions: {line: {enableMouseTracking: true, lineWidth: 3, marker: {fillColor: "#FFFFFF", lineColor: "#000000", lineWidth: 1}}}
                                       ,series: [{name: "Pagas", data: [0,0,0,0,0,0,0], color: "#FF0000"}, {name: "Geradas", data: [0,0,0,0,0,0,0], color: "#00A000"}]
                                       ,loading: {hideDuration: 500, showDuration: 500, labelStyle: { fontSize: "20pt", top: "23%"}, style: {opacity: 0.90}}
                                      });

      guiasAgora = new Highcharts.Chart({chart: {renderTo: "guiasagora", type: "column", height: 300, width: 300}
                                        ,credits: { enabled: false }
                                        ,title: {text: "Guias agora"}
                                        ,subtitle: {text: "(??/??/??)"}
                                        ,xAxis: {title: {text: "Momento da obtenção dos dados"}, categories: ["??/??/????"]}
                                        ,yAxis: {min: 0, title: {text: "Quantidade"}, alternateGridColor: "#EFEFEF"}
                                        ,legend: {align: "right", layout: "vertical", verticalAlign: "top", y: 45}
                                        ,tooltip: {formatter: function() { return "Guias " + this.series.name + ": " + this.y; }}
                                        ,series: [{name: "Pagas", data: [20], color: "#FF0000"}, {name: "Geradas", data: [10], color: "#00A000"}]
                                        ,loading: {hideDuration: 500, showDuration: 500, labelStyle: { top: "85px", left: "13px"}, style: {opacity: 0.90}}});
      
      pagamentosIndevidosXDia =  new Highcharts.Chart({chart: {renderTo: "pagamentosindevidosxdia", type: "column", width: 905, height: 300}
                                                      ,credits: { enabled: false }
                                                      ,title: {text: "Pagamentos indevidos X Dia"}
                                                      ,subtitle: {text: "(Últimos sete dias)"}
                                                      ,xAxis: {title: {text: "Dias da obtenção dos dados"}, categories: ["??/??/??","??/??/??","??/??/??","??/??/??","??/??/??","??/??/??","??/??/??"]}
                                                      ,yAxis: {min: 0, title: {text: "Quantidade"}, alternateGridColor: "#EFEFEF"}
                                                      ,legend: {enabled: false}
                                                      ,tooltip: {formatter: function() { return "Pagamentos indevidos: " + this.y; }}
                                                      ,series: [{name: "Quantidades", data: [0,0,0,0,0,0,0], color: "#FF0000"}]
                                                      ,loading: {hideDuration: 500, showDuration: 500}});
                                                      
      pagamentosIndevidosAgora = new Highcharts.Chart({chart: {renderTo: "pagamentosindevidosagora", type: "column", height: 300, width: 300}
                                                      ,credits: { enabled: false }
                                                      ,title: {text: "Pagamentos indevidos agora"}
                                                      ,subtitle: {text: "(??/??/??)"}
                                                      ,xAxis: {title: {text: "Momento da obtenção dos dados"}, categories: ["??/??/????"]}
                                                      ,yAxis: {min: 0, title: {text: "Quantidade"}, alternateGridColor: "#EFEFEF"}
                                                      ,legend: {enabled: false}
                                                      ,tooltip: {formatter: function() { return "Pagamentos indevidos: " + this.y; }}
                                                      ,series: [{name: "Quantidades", data: [10], color: "#FF0000"}]
                                                      ,loading: {hideDuration: 500, showDuration: 500, labelStyle: { top: "85px", left: "13px"}, style: {opacity: 0.90}}});

      sumarioMonetarioXDia =  new Highcharts.Chart({chart: {renderTo: "sumariomonetario", type: "column", width: 905, height: 300}
                                                   ,credits: { enabled: false }
                                                   ,title: {text: "Sumário monetário X Dia"}
                                                   ,subtitle: {text: "(Últimos sete dias)"}
                                                   ,xAxis: {title: {text: "Dias da obtenção dos dados"}, categories: ["??/??/??","??/??/??","??/??/??","??/??/??","??/??/??","??/??/??","??/??/??"]}
                                                   ,yAxis: {min: 0, title: {text: "Valor (R$)"}, alternateGridColor: "#EFEFEF"}
                                                   ,legend: {align: "right", layout: "vertical", verticalAlign: "top", y: 45}
                                                   ,tooltip: {enabled: true, formatter: function() { return this.series.name + ": " + this.y; }}
                                                   ,series: [{name: "Emolumento", data: [0,0,0,0,0,0,0], color: "#0000FF"}, {name: "TSNR", data: [0,0,0,0,0,0,0], color: "#00FF00"}, {name: "FERC", data: [0,0,0,0,0,0,0], color: "#FF0000"}]
                                                   ,loading: {hideDuration: 500, showDuration: 500}});

      sumarioMonetarioAgora =  new Highcharts.Chart({chart: {renderTo: "sumariomonetarioagora", type: "column", width: 300, height: 300}
                                                   ,credits: { enabled: false }
                                                   ,title: {text: "Sumário monetário agora"}
                                                   ,subtitle: {text: "(??/??/????)"}
                                                   ,xAxis: {title: {text: "Momento da obtenção dos dados"}, categories: ["??/??/??"]}
                                                   ,yAxis: {min: 0, title: {text: "Valor (R$)"}, alternateGridColor: "#EFEFEF"}
                                                   ,legend: {align: "right", layout: "vertical", verticalAlign: "top", y: 45}
                                                   ,tooltip: {enabled: true, formatter: function() { return this.series.name + ": " + this.y; }}
                                                   ,series: [{name: "Emolumento", data: [10], color: "#0000FF"}, {name: "TSNR", data: [20], color: "#00FF00"}, {name: "FERC", data: [30], color: "#FF0000"}]
                                                   ,loading: {hideDuration: 500, showDuration: 500}});

      atrasoArquivoRetorno = new Highcharts.Chart({chart: {renderTo: "atrasoarquivoretorno"
                                                          ,type: "gauge"
                                                          ,plotBackgroundColor: null
                                                          ,plotBackgroundImage: null
                                                          ,plotBorderWidth: 0
                                                          ,plotShadow: false
                                                          ,height: 300
                                                          ,width: 300}
                                                  ,credits: { enabled: false }
                                                  ,title: {text: "Atraso do EDI"}
                                                  ,subtitle: {text: "(Arquivo de retorno)"}
                                                  ,pane: {startAngle: -150
                                                         ,endAngle: 150
                                                         ,background: [{backgroundColor: {linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }
                                                                                         ,stops: [[0, "#FFF"],[1, "#333"]]}
                                                                       ,borderWidth: 0
                                                                       ,outerRadius: "109%"}
                                                                      ,{backgroundColor: {linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }
                                                                                         ,stops: [[0, "#333"],[1, "#FFF"]]}
                                                                       ,borderWidth: 1
                                                                       ,outerRadius: "107%"}
                                                                      ,{/*default background*/}
                                                                      ,{backgroundColor: "#DDD"
                                                                       ,borderWidth: 0
                                                                       ,outerRadius: "105%"
                                                                       ,innerRadius: "103%"}]}
                                                  ,yAxis: {min: 0
                                                          ,max: 32
                                                          ,minorTickInterval: "auto"
                                                          ,minorTickWidth: 1
                                                          ,minorTickLength: 10
                                                          ,minorTickPosition: "inside"
                                                          ,minorTickColor: "#666"
                                                          ,tickPixelInterval: 30
                                                          ,tickWidth: 2
                                                          ,tickPosition: "inside"
                                                          ,tickLength: 10
                                                          ,tickColor: "#666"
                                                          ,labels: {step: 2
                                                                   ,rotation: "auto"}
                                                          ,title: {text: "Minutos"}
                                                          ,plotBands: [{from: 0
                                                                       ,to: 8
                                                                       ,color: "#00FF00"}
                                                                      ,{from: 8
                                                                       ,to: 16
                                                                       ,color: "#FFFF00"}
                                                                      ,{from: 16
                                                                       ,to: 32
                                                                       ,color: "#FF0000"}]}
                                                  ,series: [{name: "Atraso"
                                                            ,data: [20]
                                                            ,tooltip: {valueSuffix: " minutos"}}]
                                                  ,loading: {hideDuration: 500
                                                            ,showDuration: 500}});
                                                            
      setTimeout("inicializarPooling()",1000);
      /* ============================================= */
                      });
    </script>
  </head>
  <body id="eita">
    <table border="0" cellpadding="0" cellspacing="5" align="center">
      <tr>
        <td style="font-size: 14pt; text-align: center; background-color: #c0c0c0; color: #FFFFFF; border-radius: 5px">HISTÓRICO</td>
        <td style="font-size: 14pt; text-align: center; background-color: #c0c0c0; color: #FFFFFF; border-radius: 5px">ATUAL</td>
        <td style="font-size: 14pt; text-align: center; background-color: #c0c0c0; color: #FFFFFF; border-radius: 5px">SAÚDE DO SISTEMA</td>
      </tr>
      <tr>
        <td id="guiasxdia"></td>
        <td id="guiasagora"></td>
        <td id="atrasoarquivoretorno"></td>
      </tr>
      <tr>
        <td id="pagamentosindevidosxdia"></td>
        <td id="pagamentosindevidosagora"></td>
        <td id="arquivos" style="border-radius: 5px; border: 2px solid #4572A7;">Aqui vão ficar as informações sobre arquivos</td>
      </tr>
      <tr>
        <td id="sumariomonetario"></td>
        <td id="sumariomonetarioagora"></td>
        <td id="xs">???</td>
      </tr>
    </table>
    <hr>
    <table class="linhaomega" cellpadding="2" cellspacing="0">
      <tr>
        <td width="50%" valign="top"><img src="img/tjpe.png" alt="Tribunal de Justiça de Pernambuco" style="float: left; margin-right: 5px;" title="Tribunal de Justiça de Pernambuco" width="50" height="50" border="0"><i>Made in <b><abbr title="Unidade de Engenharia de Software - Gestão do Conhecimento e Administrativo">UES-A</abbr></b></i><br><abbr title="Secretaria de Tecnologia da Informação e Comunicação">SETIC</abbr> - <abbr title="Diretoria de Sistemas">DISIS</abbr> - <abbr title="Gerência de Desenvolvimento">GEDES</abbr><br>Copyright &copy; 2013 <a href="http://www.tjpe.jus.br" title="Tribunal de Justiça de Pernambuco">Tribunal de Justiça de Pernambuco</a></td>
        <td width="50%" align="right"><a href="http://script.aculo.us/" target="_new"><img src="img/sct.png" alt="Powered by Scriptaculous" title="Powered by Scriptaculous" width="257" height="50" border="0"></a>&nbsp;&nbsp;<a href="http://www.prototypejs.org/" target="_new"><img src="img/ptt.png" alt="Powered by Prototype JS Framework" title="Powered by Prototype JS Framework" width="96" height="50" border="0"></a>&nbsp;&nbsp;<a href="http://www.highcharts.com" target="_new"><img src="img/hch.png" alt="Powered by Highcharts JS" title="Powered by Highcharts JS" width="246" height="50"></a>
      </tr>
    </table>
  </body>
</html>                                                           
